<?php 
	session_start(); 
	if (!$_SESSION["id_no"])
    {
        Header("Location: index.php");
    }
	else{
		if ($_SESSION['account_type']=='root'){
			$header="secured/header_login";
			$admin="yes";
		}
		elseif($_SESSION['account_type']=='Admin'){ 
			$header="secured/header_login";
			$admin="yes";
		}else{
			$header="header";
			$admin="no";
		}
	}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Ralimo System Panel</title>
<link rel="stylesheet" href="css/screen.css" type="text/css" media="screen" title="default" />
<link rel="stylesheet" href="css/jquery-ui-1.8.21.custom.css" type="text/css" media="screen" title="default" />
<!--[if IE]>
<link rel="stylesheet" media="all" type="text/css" href="css/pro_dropline_ie.css" />
<![endif]-->
<!--  jquery core -->
<script src="js/jquery/jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="js/jquery/jquery-ui-1.8.21.custom.min.js" type="text/javascript"></script>
<!--  date picker script -->
<link rel="stylesheet" href="css/datePicker.css" type="text/css" />
<script type="text/javascript" src="js/jquery/infowindow.js"></script>
</head>
<body> 
<?php 
	include"template/$header.php"; 
	
	$id = $_GET['id'];
	require "query/db_connection.php";

	$sql = "SELECT
			affiliate.companyname
			FROM
			affiliate
			WHERE 
			affiliateid='$id'";
	$res = mysql_query($sql);
	$count = mysql_num_rows($res);
	while($row = mysql_fetch_array($res)){
		$companyname = $row['companyname'];
	}
	
	$sql1="SELECT
			drivers.driversname,
			drivers.contactno,
			drivers.image
			FROM
			drivers
			WHERE
			affiliateid='$id'";
	$res1 = mysql_query($sql1);
	
?>
  <div class='clear'></div>
<!-- start content-outer ........................................................................................................................START -->
	<div id='content-outer'>
	<!-- start content -->
	<div id='content'>

	<!--  start page-heading -->
	<div id='page-heading'>
		<h1><?php echo $companyname;?> Driver</h1>
	</div>
	<!-- end page-heading -->
	<br />
	<div id="back_affiliate_driver">
		<a href="<?php echo"add_affiliate_driver.php?id=".$id;?>"><img alt="drivers" style="border:none;"  src="images/forms/add_driver.gif" /></a>
		<a href="<?php echo"affiliate_vehicles.php?id=".$id;?>"><img alt="vehicles" style="border:none;" src="images/forms/vehicles.png" /></a>
		<a href="<?php echo"affiliate_airport_rates.php?id=".$id;?>"><img alt="rates" style="border:none;" src="images/forms/rates.gif" /></a>
		<a href="<?php echo"notes.php?id=".$id;?>"><img alt="notes" style="border:none;" src="images/forms/notes.gif" /></a>
		<a href="<?php echo"affiliate_vehicles.php?id=".$id;?>"><img alt="back" style="border:none;" src="images/forms/back.png" /></a>
	</div>

	<table border='0' width='100%' cellpadding='0' cellspacing='0' id='content-table'>
	<tr>
		<th rowspan='3' class='sized'><img src='images/shared/side_shadowleft.jpg' width='20' height='300' alt='' /></th>
		<th class='topleft'></th>
		<td id='tbl-border-top'>&nbsp;</td>
		<th class='topright'></th>
		<th rowspan='3' class='sized'><img src='images/shared/side_shadowright.jpg' width='20' height='300' alt='' /></th>
	</tr>
	<tr>
		<td id='tbl-border-left'></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id='content-table-inner'>
		
			<!--  start table-content  -->
			<div id='table-content'>
			<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check" id="head">No.#</th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Driver's Name:</a>	</th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Contact Number:</a></th>
					<th class="table-header-repeat line-left"><a href="">Image:</a></th>
				</tr>
				<tr>
					<?php
						$acc_num = 0;
						$class_alternate = "";
						while($row = mysql_fetch_array($res1)){
						$acc_num=$acc_num+1;
						echo "<tr class='".$class_alternate."'>
								<td>".$acc_num."</td>
								<td>".$row['driversname']."</td>
								<td>".$row['contactno']."</td>
								<td><img src='".$row['image']."'></td>
							  </tr>";
							}
					?>
				</tr>
				</table>
				<!--  end product-table................................... --> 
			</div>
			<!--  end table-content  -->
			<div class='clear'></div>
		</div>
		<!--  end content-table-inner ............................................END  -->
		</td>
		<td id='tbl-border-right'></td>
	
	<tr>
		<th class='sized bottomleft'></th>
		<td id='tbl-border-bottom'>&nbsp;</td>
		<th class='sized bottomright'></th>
	</tr>
	</table>
	<div class='clear'>&nbsp;</div>

	</div>
	<!--  end content -->
	<div class='clear'>&nbsp;</div>
	</div>
	<!--  end content-outer........................................................END -->";
				
<!--  start nav-outer-repeat................................................... END -->

  <div class="clear"></div>
 
<!-- start content-outer ........................................................................................................................START -->
<div id="content-outer">
<!-- start content -->
<!--  end content -->
<div class="clear">&nbsp;</div>
</div>
<!--  end content-outer........................................................END -->

<div class="clear">&nbsp;</div>
    
<?php include"template/footer.php"; ?>
 
</body>
</html>